home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / ANTENNA / YAGIU112 / Z_INPUT.C < prev    next >
C/C++ Source or Header  |  1995-08-07  |  537b  |  25 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <errno.h>
  4. #include "yagi.h"
  5. extern int errno;
  6.  
  7. /* compute the input impedance (driving impedance) */
  8.  
  9. void z_input(struct FCOMPLEX v, struct FCOMPLEX i, struct FCOMPLEX *impedance)
  10. {
  11.     *impedance=Cdiv(v,i);
  12.        /* printf("Voltage=%lf + i %lf\n", v.r, v.i);
  13.     printf("Current = %lf + i %lf \n", i.r, i.i); 
  14.     printf("Z = V/I = %lf + %lf \n", impedance->r, impedance->i); */
  15.  
  16. #ifdef DEBUG
  17.     if(errno)
  18.     {
  19.         fprintf(stderr,"Errno =%d in z_input() in z_input.c\n", errno);
  20.         exit(1);
  21.     }
  22. #endif
  23. }
  24.  
  25.